<%@ page language="java" import="java.util.*,entity.*,dao.*,dao.impl.*" pageEncoding="UTF-8"%>
<%
  		ReplyDao replyDao = new ReplyDaoImpl(); 
		int boardId = Integer.parseInt(request.getParameter("boardId"));
		int topicId = Integer.parseInt(request.getParameter("topicId"));
		int replyId = Integer.parseInt(request.getParameter("replyId"));
		User user = (User)session.getAttribute("user");
		
		
		
		if( user!=null && user.getUserId()==replyDao.findReply(replyId).getUserId()) { 
			replyDao.deleteReply( replyId );							     
			response.sendRedirect("../detail.jsp?page=1&boardId="+boardId+"&topicId="+topicId);      
			return;
		} else {
			response.sendRedirect("../error.jsp");
		}
%>